package com.fnzn.entranceGuard.feign;

import com.fnzn.entranceGuard.entity.User;
import com.fnzn.entranceGuard.util.ResponseUtil;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author wf_sxf@163.com
 * @date 2018/5/23 22:21
 */
//@FeignClient(name = "gate-way", fallback = UserInfoServiceFallbackImpl.class)
public interface ApiToken {
    /**
     * 通过用户换去token
     *
     * @return ResponseEntity
     */
    @RequestMapping(value = "/api/authen/getUserToken",method = RequestMethod.POST)
    ResponseUtil getUserToken(@RequestBody User user);

    /**
     * 通过失效token换取新token
     *
     * @return ResponseEntity
     */
    @RequestMapping(value = "/api/authen/refreshUserToken",method = RequestMethod.GET)
    ResponseUtil refreshUserToken(@RequestParam("token") String token);


}
